package com.swhysc.information.entity;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.util.Date;

/**
 * @Author zmq
 * @Date 2022/10/13 17:00
 * @Description 资讯数据表字段实体
 */
@Entity
@Table(name = "INFORMATION_DATA_COLUMN_EX", indexes = {
        @Index(columnList = "TABLE_ID") })
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@Data
public class InformationDataColumnEx {
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name = "ID")
    private String id;

    //字段中文名
    @Column(name = "CH_NAME")
    private String chName;

    //英文名
    @Column(name = "EN_NAME")
    private String enName;

    //字段类型
    @Column(name = "COL_TYPE")
    private String colType;

    //所属表 id
    @Column(name = "TABLE_ID")
    private String tableId;

    //数据源 id
    @Column(name = "DATA_SOURCE_ID")
    private String dataSourceId;

    //是否唯一 1是 0否
    @Column(name = "IS_UNIQUE")
    private String isUnique;

    //是否为空 1是 0否
    @Column(name = "IS_NUll")
    private String isNull;

    //是否主键 1是 0否
    @Column(name = "IS_KEY")
    private String isKey;

    /*//创建人
    @Column(name = "CREATE_USER")
    private String createUser;*/

    //创建时间
    @Column(name = "CREATE_TIME")
    private Date createTime;

    /*//修改人
    @Column(name = "UPDATE_USER")
    private String updateUser;*/

    //修改时间
    @Column(name = "UPDATE_TIME")
    private Date updateTime;

    //备注
    @Type(type = "org.hibernate.type.MaterializedClobType")
    @Column(name = "REMARK")
    private String remark;
}
